package com.yjd.bi.market.dao.impl;

import java.util.Map;

import org.springframework.stereotype.Component;

import com.yjd.comm.base.dao.impl.BaseDaoImpl;
import com.yjd.bi.market.model.MarketStatisticsModel;
import com.yjd.bi.market.dao.IMarketStatisticsDao;

/**
 * <b>description</b>：资金量记录数据访问层 <br>
 * <b>time</b>：2016-05-25 10:23:24 <br>
 * <b>author</b>： chenpengfei@yijeidai.com
 */
@Component("marketStatisticsDao")
public class MarketStatisticsDaoImpl extends BaseDaoImpl implements IMarketStatisticsDao {

	private static final String SQLMAPNAMESPACE = MarketStatisticsModel.class.getName();
	private static final String PKNAME = "id";

	@Override
	public String getPrimaryKeyName() {
		return PKNAME;
	}

	@Override
	public String getSqlmapNamespace() {
		return SQLMAPNAMESPACE;
	}
	@Override
	public double getFundsSum(Map<String, Object> paramMap, boolean b) {
		Object myObject = this.getSqlMap(b).queryForObject(this.getStatement("userSum"),paramMap);
		if (myObject != null) {
			return Double.parseDouble(myObject.toString());
		}
		return 0.00D;
	}
	

	@Override
	public Integer recharge_account(Map<String, Object> paramMap) {
		// TODO Auto-generated method stub
		return (Integer) this.getSqlMap(false).queryForObject(
				getStatement("recharge_account"), paramMap);
	}

	@Override
	public Integer register_account(Map<String, Object> paramMap) {
		// TODO Auto-generated method stub
		return (Integer) this.getSqlMap(false).queryForObject(
				getStatement("register_account"), paramMap);
	}

	@Override
	public Integer invest_account(Map<String, Object> paramMap) {
		// TODO Auto-generated method stub
		return (Integer) this.getSqlMap(false).queryForObject(
				getStatement("invest_account"), paramMap);
	}

	@Override
	public Double getSummary(Map<String, Object> paramMap) throws Exception {
		// TODO Auto-generated method stub
		return (Double) this.getSqlMap(false).queryForObject(
				getStatement("getSummary"), paramMap);
	}

	@Override
	public Double recharge_price(Map<String, Object> paramMap) {
		// TODO Auto-generated method stub
		return (Double) this.getSqlMap(false).queryForObject(
				getStatement("recharge_price"), paramMap);
	}

	@Override
	public Double invest_price(Map<String, Object> paramMap) {
		// TODO Auto-generated method stub
		return (Double) this.getSqlMap(false).queryForObject(
				getStatement("invest_price"), paramMap);
	}

}
